package com.gao.api.gate.quick.core.server;

import com.gao.api.gate.quick.core.lifecycle.Lifecycle;

import java.net.InetSocketAddress;
import java.util.concurrent.Executor;

/**
 * <p></p>
 *
 * @author gaoshuangwen
 * @since 2021/12/23 15:10
 */
public interface Server extends Lifecycle {
    /**
     * 暂停处理业务
     *
     * @throws Exception
     */
    void pause() throws Exception;

    void resume() throws Exception;

    void serPort(int port);

    int getPort();


    InetSocketAddress getLocalAddress();

    /**
     * The executor, provide access to the underlying thread pool.
     *
     * @return The executor used to process requests
     */
    Executor getExecutor();

    boolean isClosed();

    void shutdown();

}
